package com.test;

import java.util.Random;

public class grace1 {
    int random(double a, double b) {
        //实现随机运算符号，加法和减法，并输出算式
        Random random = new Random();
        int tmp = random.nextInt(2);
        switch (tmp) {
            case 0:
                System.out.println("本题为加法");
                System.out.println(a+"+"+b+"=");
                break;
            case 1:
                System.out.println("本题为减法");
                System.out.println(a+"-"+b+"=");
                break;
        }
        return tmp;
    }
}
